1. Field of the Invention
The present invention relates to picture coding devices, and particularly to improvement for enhancing visual picture quality.
2. Description of the Background Art
FIG. 46 is a block diagram showing the structure of a conventionally known picture coding device as a background of the invention. This device 151 realizes the conventionally known picture coding system shown in "ISO-IEC/JTC1/SC29/WG11 MPEG93/225B Test Model4."
As shown in FIG. 46, a digitized picture (image) signal (input picture) PS is inputted to an activity calculating portion 11. The activity calculating portion 11 calculates the degree of variation of pixel values in the input picture signal PS and transmits the result to a control portion 91 as an activity signal 31. The picture signal PS passing through the activity calculating portion 11 is inputted to a switching portion 12.
The switching portion 12 includes a differential circuit for calculating a difference of pixel values between the picture signal PS transmitted from the activity calculating portion 11 and a predictive picture 30 from a motion compensation portion 18. The switching portion 12 further includes a switch portion for selecting and outputting one of the differential picture signal from the differential circuit and the picture signal PS from the activity calculating portion 11. The switch portion operates in response to a selection signal 32 from the control portion 91.
The signal outputted from the switch portion is inputted to a discrete cosine transform portion (DCT) 13. The DCT 13 performs the so-called discrete cosine transform. In the discrete cosine transform, the picture signal PS is transformed for each block composed of 8.times.8 pixels, for example, into a set of space frequency components (DCT coefficients) as many as the pixels forming the block (e.g., 8.times.8=64). The DCT coefficients obtained by the transform are inputted to a quantization portion 14.
The quantization portion 14 refers to a set of coefficient values defined in a quantization table included therein and a quantization step direction signal 33 sent from the control portion 91 to conduct quantization for each DCT coefficient. That is to say, the DCT coefficients are transformed into quantization coefficients. The quantization step direction signal 33 uniformly provides a common multiplier factor to the set of coefficient values defined in the quantization table to correct the width of quantization based on the quantization table, that is, the quantization steps, with the common multiplier factor to all DCT coefficients. As the quantization step becomes smaller, deterioration of picture quality is suppressed, but the amount of signal increases.
The quantization coefficient obtained in the quantization portion 14 is inputted to a variable-length coding portion (VLC) 19 and also inputted to an inverse quantization portion 15. The inverse quantization portion 15 performs inverse operation to that in the quantization portion 14. Accordingly, a signal in the same form as the DCT coefficient before quantized is obtained.
Since the processing in the quantization portion 14 is generally non-reversible i.e. lossy, however, the DCT coefficient reconfigured in the inverse quantization portion 15 is generally not the same as the DCT coefficient outputted from the DCT 13. That is to say, the output from the inverse quantization portion 15 generally includes a quantization error caused by the processing in the quantization portion 14. Needless to say, the quantization error becomes smaller as the quantization step becomes smaller.
The DCT coefficient obtained in the inverse quantization portion 15 is inputted to an inverse discrete cosine transform portion (inverse DCT) 16. The inverse DCT 16 performs inverse operation to that in the DCT 13. As a result, a signal in the same form as the picture signal PS before subjected to DCT transform in the DCT 13 is obtained. Needless to say, this picture signal is generally not the same as the picture signal PS but it includes a quantization error.
The reconfigured picture signal is stored in frame (picture; a piece of picture) units into a frame memory 17 as a signal for a reference picture. The reference picture signal stored in the frame memory 17 is inputted to the motion compensation portion 18.
The picture signal PS inputted to the activity calculating portion 11 is inputted to the motion compensation portion 18 too. Then the motion compensation portion 18 searches for part of the reference picture which is the closest to the picture signal PS in macro block units and sends it to the differential circuit in the switching portion 12 as a predictive picture 30. It also sends vector representing displacement from the predictive picture to the corresponding macro block on the picture signal PS to the VLC 19 as motion vector V.
The macro block is a unit of picture defining the motion vector V, which is formed of 16.times.16 pixels for luminance signal and 8.times.8 pixels for color-difference signal, for example. When the macro block is defined with 16.times.16 pixels for the luminance signal, the DCT transform process in the DCT 13 and the quantization process in the quantization portion 14 are applied to the luminance signal in each of blocks of 8.times.8 pixels, a quarter of one macro block.
The switching portion 12 sends the picture signal PS (non-differential picture 35) and the differential picture 36 to the control portion 91. The control portion 91 compares the non-differential picture 35 and the differential picture 36 in macro block units and sends the selection signal 32 so that the switch portion selects one having a smaller pixel value, in other words, one having a smaller amount of signal.
In the VLC 19, variable-length coding such as the Huffman coding is applied to the inputted quantization coefficient to provide a coded signal CS. At this time, the motion vector V sent from the motion compensation portion 18 is added as part of the coded signal CS. This enables a decoding device which reconfigures the picture signal PC from the coded signal CS to decode taking the motion vector V into account.
The coded signal CS is once accumulated in an output buffer 20 and then outputted to the outside at proper time. The output buffer 20 sends out a status signal 34 indicative of its status, i.e., whether the buffer is overflowing or vacant, to the control portion 91.
The control portion 91 outputs the selection signal 32 and the quantization step direction signal 33 on the basis of the activity signal 31, the status signal 34, the non-differential picture 35 and the differential picture 36.
FIG. 47 is a block diagram showing the internal structure of the control portion 91. As shown in FIG. 47, the control portion 91 includes a quantization step control portion 51 and an inter/intra direction portion 42. The quantization step control portion 51 sends the quantization step direction signal 33 for controlling the quantization portion 14 on the basis of the activity signal 31 and the status signal 34. The inter/intra direction portion 42 sends the selection signal 32 for controlling the switch portion of the switching portion 12 on the basis of the non-differential picture 35 and the differential picture 36.
The quantization step control portion 51 includes a target bit allocate portion 43, a rate control portion 44 and an adaptive quantization portion 45. The control portion 91 including these components operates according to the flow chart of FIG. 48. That is to say, when processing is started, first, in Step S1, the target bit allocate process is performed.
This process is for evaluating the number of bits of signal required to code the picture signal PS prior to the coding, which is performed by the target bit allocate portion 43. The processings in individual steps in FIG. 48, including the Step S1, are performed in macro block units.
Next, in Step S2, the rate control processing is executed. This process is for setting the quantization step as a reference value for each macro block, which is conducted in the rate control portion 44. As has been stated above, the quantization portion 14 is provided with a quantization table including coefficient values individually defining quantization steps for each DCT coefficient in a macro block. Each component of the quantization table is uniformly multiplied by a correction coefficient to secondarily set the quantization step. The processing in Step S2 just corresponds to the process of preparatorily setting the correction coefficient in macro block units.
Next, in Step S3, the adaptive quantization processing is conducted. In this processing, the preparatorily set correction coefficient is modified on the basis of the activity signal 31 and the status signal 34 to finally determine the quantization step. Then the quantization step direction signal 33 corresponding to the determined quantization step is transferred to the quantization portion 14. This processing is accomplished in the adaptive quantization portion 45.
Next, in Step S4, the processing for directing inter/intra is conducted. This processing is carried out in the inter/intra direction portion 42. As has been stated above, in this processing, the pixel values are compared in macro block units between the non-differential picture 35 and the differential picture 36 and the selection signal 32 is outputted to the switching portion 12 so that one having a smaller pixel value, i.e., one having a smaller amount of signal is selected. As a result, the DCT 13 is fed with a picture signal of the smaller quantity.
Next, the process moves to Step S6 to determine whether the process is to be terminated or not. If it is determined that the process should be terminated, it is terminated. On the other hand, if it is determined that the process should not to be terminated because there remain macro blocks to be processed, for example, the process returns to Step S1 and the processings in and after Step S1 are applied to the next macro block. This way, processings are applied to all macro blocks one after another.
As stated above, the conventional device 151 is constructed so that the inter-picture coding (inter coding) using motion compensative prediction, one of high-efficiency coding systems, and the intra-picture coding (intra coding) of coding inside a piece of picture (frame; picture) can be selectively executed in macro block units, when coding the picture signal PS.
The conventional device 151 constructed and operating as explained above have the following problems.
Visually recognized picture quality, i.e., visual picture quality generally varies depending on motion of picture. That is to say, it is known that deterioration of picture quality due to coding is visually more noticeable in a picture with slow motion than in a picture with fast motion. This is due to the fact that the eyes have difficulty in following a picture with rapid motion and that the visual resolution is held high for a slow-motion picture or a still picture having a less amount of time differential information. Thus the visual picture quality generally depends on magnitude of the motion vector V.
However, the conventional device 151 does not consider the relation between the motion vector V and the subjective picture quality in coding, resulting in the problem that the coded signal CS becomes redundant for macro blocks with large motion vector V, and on the other hand, deterioration of picture quality is noticeable for macro blocks with small motion vector V.
Furthermore, in the conventional device 151, magnitude of the quantization step of the predictive picture is not considered in coding, which results in the problem that when the quantization step of the predictive picture is large and the quantization error is large, the large quantization error is transmitted to the coded signal CS obtained by inter-picture coding using the predictive picture. That is to say, deterioration of picture quality caused by coding is unnecessarily transmitted to the following pictures.